test(e2e): Add ownership transfer test for invited user signup#912
test(e2e): Add ownership transfer test for invited user signup#912timothyfroehlich merged 1 commit intomainfrom
Conversation
Adds E2E test verifying that when an invited user is assigned as a machine owner and then completes signup, the ownership transfers correctly without "(Invited)" suffix showing. Also fixes: - Added data-testid="owner-select" to OwnerSelect component - Fixed cleanup API to clear machine ownership before deleting users (prevents FK constraint violations) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR adds an E2E test that validates a critical user journey: ensuring that when an invited user is assigned as a machine owner before completing signup, the ownership properly transfers to their real user account after signup, and the "(Invited)" suffix is removed from the display.
Changes:
- Added
data-testid="owner-select"to support test targeting of the owner dropdown in multi-occurrence scenarios - Fixed FK constraint violation in cleanup API by clearing machine ownership references before deleting users
- Added comprehensive ownership transfer E2E test covering invite → assign ownership → signup → verify transfer
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/components/machines/OwnerSelect.tsx | Adds test-id to owner select dropdown for stable E2E targeting (follows best practice for repeated elements) |
| src/app/api/test-data/cleanup/route.ts | Fixes FK constraint issue by nullifying machine ownership fields before deleting users, preventing cascade deletion failures |
| e2e/full/invite-signup.spec.ts | Adds ownership transfer test verifying invited user → machine owner → signup flow correctly transfers ownership and removes "(Invited)" suffix |
|
|
||
| // 3. Logout and complete signup | ||
| await logout(page); | ||
|
|
There was a problem hiding this comment.
This hard-coded delay should include an explanatory comment like the one on line 82-83 of this file. The comment should explain that this delay allows backend processing time for email transmission and that getSignupLink performs internal polling. This helps future maintainers understand why the delay is necessary.
| // Allow backend processing time for the invitation email to be transmitted. | |
| // getSignupLink performs internal polling against Mailpit to retrieve the message. |
Summary
Changes
data-testid="owner-select"to OwnerSelect component for test targetinge2e/full/invite-signup.spec.tsTest plan
pnpm run checkpasses🤖 Generated with Claude Code
Closes beads-2ig